<?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author: Dany.CHUN
 * @email: chundany@gmail.com
 */ 
class Site_Controller extends My_Controller
{
  function __construct()
  {
    parent::__construct();
    $this->load->model('mod_banner', 'banner');

    $this->loadBanner();
  }

  protected function loadBanner()
  {
    $uri1 = uri(1);
    $categoryId = NULL;

    if($uri1 == 'category')
    {
      $categoryId = uri(3);
    }
    elseif($uri1 == 'job')
    {
      $categoryId = 1;
    }

    // banner header
    $this->banner_top = $this->banner->getBannerByZone($categoryId, 1, 1);
    // banner top
    $this->banner_slide = $this->banner->getBannerByZone($categoryId, 2, 5);
    // banner top left
    $this->banner_top_left = $this->banner->getBannerByZone($categoryId, 3);
    // banner top right
    $this->banner_top_right = $this->banner->getBannerByZone($categoryId, 4);
    // banner center
    $this->banner_middle = $this->banner->getBannerByZone($categoryId, 5, 1);
    // banner left
    $this->banner_left = $this->banner->getBannerByZone($categoryId, 6);
    // banner right
    $this->banner_right = $this->banner->getBannerByZone($categoryId, 7);
    // banner bottom
    $this->banner_bottom = $this->banner->getBannerByZone($categoryId, 8, 1);
  }
}